<template>
  <div class="CreateView">
    <CreateForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></CreateForm>

    <div class="footer">
      <a-button type="primary" @click="handleOk" style="margin-left: 140px;">
        确认
      </a-button>
    </div>
  </div>
</template>

<script>

  import CreateForm from './CreateForm'

  export default {
    name: 'CreateModal',
    components: {
      CreateForm
    },
    data() {
      return {
        title: '操作',
        width: 700,
        visible: false,
        disableSubmit: false
      }
    },
    methods: {
      add() {
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
        })
      },
      edit(record) {
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.edit(record)
        })
      },
      close() {
        this.$emit('close')
        this.visible = false
      },
      submitCallback() {
        // this.$emit('ok')
        this.$router.push('/sjcj/mbgl/index');
        // this.visible = false
      },
      handleOk() {
        this.$refs.realForm.submitForm()
      },
      handleCancel() {
        this.close()
      }
    }
  }
</script>

<style lang="less" scoped>
.CreateView {
  box-sizing: border-box;
  padding: 50px 150px 0 150px;
  ::v-deep .left-sidebar {
    left: 140px;
  }
  ::v-deep .uploadBox {
    margin-left: 207px!important;
  }
  ::v-deep .fileList {
    margin-left: 207px!important;
  }
}
</style>